def AddPage(uiName,elementName,text,iconFile="",targetUIName=''):
    """增加选项页:参数1 :界面类名, 参数2:控件名称, 参数3:页面标题,参数4:页面图标,参数5:目标界面或文件"""
    global G_ResourcesFileList
    NoteBook = GetElement(uiName,elementName)
    PageFrame = tkinter.Frame(NoteBook)
    PageFrame.place(relx = 0.0,rely = 0.0,relwidth = 1.0,relheight = 1.0)
    PageFrame.configure(bg='#888888')
    if targetUIName and len(targetUIName) > 0:
        try:
            uiClass = targetUIName
            if targetUIName.find(".py") > 0:
                UIPath, UIFile = os.path.split(targetUIName)
                if UIPath.find(":") < 0:
                    UIPath = os.path.join(G_ExeDir,UIPath)
                import sys
                sys.path.append(UIPath)
                uiClass, extension = os.path.splitext(UIFile)
            import importlib
            from   importlib import import_module
            importModule = importlib.import_module(uiClass)
            importModule = importlib.reload(importModule)
            if hasattr(importModule,"Fun") == True:
                importModule.Fun.G_ExeDir = G_ExeDir
                importModule.Fun.G_ResDir = G_ResDir
                if hasattr(importModule,"EXUIControl") == True:
                    importModule.EXUIControl.G_ExeDir = G_ExeDir
                    importModule.EXUIControl.G_ResDir = G_ResDir
            if uiClass.find('Modules.') == 0:
                LibNameArray =  uiClass.partition("Modules.")
                uiClass = LibNameArray[2]
                newClass = getattr(importModule, uiClass)
            else:
                newClass = getattr(importModule, uiClass)
            newClassInstance = newClass(PageFrame,False)
        except Exception as ex:
            MessageBox(str(ex))
    if len(iconFile) > 0 and os.path.exists(iconFile) == True:
        if elementName not in G_UIElementIconDictionary[uiName]:
            G_UIElementIconDictionary[uiName][elementName]= {}
        G_UIElementIconDictionary[uiName][elementName][text] = ImageTk.PhotoImage(file=iconFile) 
        NoteBook.add(PageFrame,text = text,image=G_UIElementIconDictionary[uiName][elementName][text],compound="left")
    else:
        NoteBook.add(PageFrame,text = text)
def GetPage(uiName,elementName,index=0):
    """取得指定页。参数1 :界面类名, 参数2:控件名称 ,参数3:索引值。"""
    NoteBook = GetElement(uiName,elementName)
    if NoteBook:
        Pages = NoteBook.winfo_children()
        if index >= 0 and index < len(Pages):
            return Pages[index]
    return None
def SelectPage(uiName,elementName,index=0):
    """选中选项页:参数1 :界面类名, 参数2:控件名称, 参数3:页面索引"""
    NoteBook = GetElement(uiName,elementName)
    if NoteBook:
        Pages = NoteBook.winfo_children()
        if index >= 0 and index < len(Pages):
            NoteBook.select(index)
def GetSelectedPageIndex(uiName,elementName):
    """取得选中页索引"""
    NoteBook = GetElement(uiName,elementName)
    if NoteBook:
        return NoteBook.index("current")
    return -1
def GetPageText(uiName,elementName,index=0):
    """取得指定页标题"""
    NoteBook = GetElement(uiName,elementName)
    if NoteBook:
        return NoteBook.tab(index,"text")
    return -1
def GetPageIndex(uiName,elementName,title):
    """取得指定页索引"""
    NoteBook = GetElement(uiName,elementName)
    if NoteBook:
        Tabs = NoteBook.tabs()
        for i in range(0,len(Tabs)):
            tabTitle = NoteBook.tab(i,"text")
            if tabTitle == title:
                return i
    return -1
def HidePage(uiName,elementName,index=0):
    """隐藏选项页:参数1 :界面类名, 参数2:控件名称, 参数3:页面索引"""
    NoteBook = GetElement(uiName,elementName)
    if NoteBook:
        Pages = NoteBook.winfo_children()
        if index >= 0 and index < len(Pages):
            NoteBook.hide(index)
def DelPage(uiName,elementName,index=0):
    """删除选项页:参数1 :界面类名, 参数2:控件名称, 参数3:页面索引"""
    NoteBook = GetElement(uiName,elementName)
    if NoteBook:
        Pages = NoteBook.winfo_children()
        if index >= 0 and index < len(Pages):
            NoteBook.forget(Pages[index])
            DestoryChild(Pages[index])